// pages/home/subscribe/com/houseItem.js
Component({
  /**
   * 组件的配置
   */
  options: {
    styleIsolation: "isolated",
    pureDataPattern: /^_/,
  },

  /**
   * 组件的属性列表
   */
  properties: {
    house: {
      type: Object,
      value: {}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的生命周期
   */
  lifetimes: {
    attached: function () {
      let t = this
    },
    detached: function () {
      // 在组件实例被从页面节点树移除时执行
    },
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onImgErr(e) {
      let t = this
      t.setData({
        'house.houseImg': '/images/defaultImgSmall.jpg'
      })
    },

    onRadar(e) {
      console.log(e.currentTarget.dataset.url)
      let radarurl = e.currentTarget.dataset.url;
      wx.navigateTo({
        url: '/pages/gatherHouse/radarHouse/radarHouse?subscribe=true&url='+encodeURIComponent(radarurl),
      })
    },

    onMoveHouse(e) {
      let moveurl = e.currentTarget.dataset.url;
      wx.navigateTo({
        url: '/pages/gatherHouse/scanAddHouse/scanAddHouse?subscribe=true&scanCode='+encodeURIComponent(moveurl),
      })
    }
  }
})